/**
 * Created by Administrator on 2017/7/27.
 */
angular.module('module.apply_for_an_originator',[])
    .config(['$stateProvider',function ($stateProvider) {
        $stateProvider
            .state('apply_for_an_originator',{
                url:'/apply_for_an_originator',
                templateUrl:'view/apply_for_an_originator.html',
                controller:'apply_for_an_originator_controller'
            })
    }])
    .controller('apply_for_an_originator_controller',['$scope','$stateParams','OriginatorService',function ($scope,$stateParams,OriginatorService) {
        console.log('apply_for_an_originatro_controller启动成功');
        $scope.originator={
            originatorId:1,
            originatorState:0
        };
        $scope.apply=function(){
            console.log("$scope.originator",$scope.originator);
            OriginatorService.addOriginator($scope.originator,function (data) {
                console.log('成功',data);
                $scope.originator=data
            },function (data) {
                console.log('失败',data);
            })
        }
    }]);